Table of Contents
General structure of elegant software:
I suspect that there is a way to formalize the general theory of elegant software using category theory and a few other bits and bobs, but for now I'll start with some lists and expand this as needed.
Configuration file
- Resides in `/etc/<program>`
- Has sample code in the repository within a `samples/<program.conf.example` file
- Configuration language is suitable for given problem, but default to Lisp for now.
- Has defaults specified. Final configuration is the unification of the two.
Logging
- Logs to stderr, stdout by default
- Accepts a `–quiet` parameter to inhibit stdout,stderr logging
- Accepts a `–verbose` parameter to increase logging intensity
- May accept a `–debug` paramter to further increase logging intensity
- Logs to `/var/log/<program>.log`
- Runs logrotate on that log at startup
Parameters
- Mandatory to accept: `–config, –debug, –verbose, –quiet, –log-file, –pid-file`
Documentation
- Versioned in the repository together with the code
Licensing
- GPL-compatible license, or AGPL-compatible
Testing
- Unit tests exist
- Pipeline runs unit tests
- In repo: Code will not merge unless all pipeline jobs succeed
Linting
- Maximum level of warnings and linting enabled
Security
- Least privilege required for any and all tasks
- Mandatory for all network connections to go over TLS
- Public-key cryptography mandatory in the case of user authentication or service-to-service
Packaging
- Packaged at least for one major distro family: RPM or DEB
Misc
- Compatible with the Red Hat / Fedora software packaging guidelines (has very strong requirements!)
Configuration file
- Resides in `/etc/<program>`
- Has sample code in the repository within a `samples/<program.conf.example` file
- Configuration language is suitable for given problem, but default to Lisp for now.
- Has defaults specified. Final configuration is the unification of the two.
Logging
- Logs to stderr, stdout by default
- Accepts a `–quiet` parameter to inhibit stdout,stderr logging
- Accepts a `–verbose` parameter to increase logging intensity
- May accept a `–debug` paramter to further increase logging intensity
- Logs to `/var/log/<program>.log`
- Runs logrotate on that log at startup
Parameters
- Mandatory to accept: `–config, –debug, –verbose, –quiet, –log-file, –pid-file`
Documentation
- Versioned in the repository together with the code
Licensing
- GPL-compatible license, or AGPL-compatible
Testing
- Unit tests exist
- Pipeline runs unit tests
- In repo: Code will not merge unless all pipeline jobs succeed
Linting
- Maximum level of warnings and linting enabled
Security
- Least privilege required for any and all tasks
- Mandatory for all network connections to go over TLS
- Public-key cryptography mandatory in the case of user authentication or service-to-service
Packaging
- Packaged at least for one major distro family: RPM or DEB
Misc
- Compatible with the Red Hat / Fedora software packaging guidelines (has very strong requirements!)